import static java.lang.Thread.sleep;

class runthread implements Runnable{
    @Override
    public void run() {
        while (true) {
            try {
                sleep(1000);
                System.out.println("实现 Runnable, 重写 run");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
public class test_2 {
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable =new runthread();
        Thread t =new Thread(runnable);
        t.start();
        while (true){
            sleep(1000);
            System.out.println("main主线程");

        }
    }

}
